
public class Test04 {
	
	
	public static void main(String[] args) {
		Student s1 = new Student(111,"hbsd");
		Student s2 = new Student(111,"hbsd");
		System.out.println(s1==s2);
		System.out.println(s1.equals(s2));
		
		
		
		
	}

}



class Student{
	int no;
	String school;
	
	public Student() {
		
	}
	public Student(int no,String school) {
		this.no=no;
		this.school = school;
	}
	
	
	@Override
	public String toString() {
		return no + " " + school;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj==null||!(obj instanceof Student)) {
			return false;
		}
		
		if(this==obj)
			return true;
		
		Student s = (Student)obj;
		if(this.no == s.no && this.school.equals(s.school) ) {
			return true;
		}
		
		
		return false;
	}
	
	
	
}









